package com.wxh.util;

import java.util.concurrent.*;

/**
 * @ClassName: Test6
 * @Description:
 * @Author wxh
 * @Date: 2022/4/20 10:10
 * @Version V1.0.0
 * @Since 1.8
 */
public class Test6 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 3; i++) {
                    System.out.println("测试多线程" + i);
                }
            }
        });

        System.out.println("------------------华丽分割线-----------------");

        ExecutorService executorService2  = new ThreadPoolExecutor(3,3,0L,
                TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(500));

        executorService2.execute(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 3; i++) {
                    System.out.println("测试多线程" + i);
                }
            }
        });

    }
}
